// @ts-ignore
/* eslint-disable */
import request from '@/utils/request'

/** 获取视频评论列表 GET /comment/video */
export async function getVideoComments(
  params: API.VideoCommentQueryParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseCommentList>('/comment/video', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 添加评论 POST /comment/add */
export async function addComment(
  body: API.CommentRequest,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseLong>('/comment/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 点赞评论 POST /comment/like */
export async function likeComment(
  params: { commentId: number },
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean>('/comment/like', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 点踩评论 POST /comment/dislike */
export async function dislikeComment(
  params: { commentId: number },
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean>('/comment/dislike', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 删除评论 POST /comment/delete */
export async function deleteComment(
  params: { commentId: number },
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseBoolean>('/comment/delete', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}
